package com.aop.demo.response;

/**
 * 
 * @ClassName: ResultCode
 * @Description: 结果类枚举(统一返回状态码)
 * @author ldq
 * @date 2020-03-28 18:10:02
 */
public enum ResultCode {

	SUCCESS(200, "成功"),
	
	/* 参数错误：10001-19999 */
	PARAM_INVALID(10001, "参数无效"),
	PARAM_NULL(10002, "参数为空"),
	PARAM_ERROR(10003, "参数错误"),
	PARAM_MISSING(10004, "参数缺失"),

	/* 用户错误：20001-29999*/
	USER_NOT_LOGIN(20001, "用户未登录"),
	USER_LOGIN_ERROR(20002, "账号不存在或密码错误"),
	USER_ACCOUNT_FORBIDDEN(20003, "账号已被禁用"),
	USER_NOT_EXIST(20004, "用户不存在"),
	USER_HAS_EXISTED(20005, "用户已存在"),
	USER_UNAUTHORIZED(20006, "用户未授权"),

	/* 业务错误：30001-39999 */
	SERVICE_ERROR(30001, "业务异常"),
	SERVICE_HANDLE_FAILURE(30001, "业务处理失败"),
	//具体业务模块异常分区定义
	/* 31000-31999 */
	/* 32000-32999 */
	/* 33000-33999 */
	
	/* 权限错误：40001-49999 */
	PERMISSION_NO_ACCESS(40001, "无访问权限"),
	NO_HANDLER_FOUND(40004, "找不到对应请求"),

	/* 系统错误：50001-59999 */
	SYSTEM_INNER_ERROR(50001, "系统内部异常"),

	/* 接口错误：60001-69999 */
	INTERFACE_INNER_INVOKE_ERROR(60001, "内部系统接口调用异常"),
	INTERFACE_OUTTER_INVOKE_ERROR(60002, "外部系统接口调用异常"),
	INTERFACE_FORBID_ACCESS(60003, "接口禁止访问"),
	INTERFACE_PARAM_INVALID(60004, "接口参数无效"),
	INTERFACE_REQUEST_TIMEOUT(60005, "接口请求超时"),
	INTERFACE_RETURN_NULL(60006, "接口返回空"),
	INTERFACE_AUTHENTICATION_FAILURE(60007, "接口鉴权失败"),

	/* 数据错误：70001-79999 */
	DATA_NOT_FOUND(70001, "数据未找到"),
	DATA_ERROR(70002, "数据错误"),
	DATA_EXISTED(70003, "数据已存在"),
	DATA_OPER_FAIL(70003, "数据操作失败");
	
	
	ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

	/**
	 * 响应状态码
	 */
	private Integer code;
	
	/**
	 * 响应信息
	 */
	private String message;

	public Integer getCode() {
		return code;
	}

	public String getMessage() {
		return message;
	}
	
}
